<template>
  <el-row>
    <el-form label-position="left" label-width="120px">
      <el-col :span="24">
        <Portlet title="物流节点">
          <el-table
            border
            :header-cell-style="{'text-align': 'center'}"
            :cell-style="{'text-align': 'center'}"
            max-height="500"
            :data="orderNodes"
            class="text-center"
          >
            <el-table-column
              prop="opTime"
              label="时间"
              width="200"
            >
              <template slot-scope="scope">
                {{ orderNodes[scope.$index]['opTime'] | unixTimestampFilter}}
              </template>
            </el-table-column>
            <el-table-column
              prop="memo"
              label="物流信息">
            </el-table-column>
          </el-table>
        </Portlet>
      </el-col>
    </el-form>
  </el-row>
</template>
<script>
export default {
  props: {
    orderId: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      orderNodes: []
    }
  },
  created() {
    if (this.orderId) {
      this.$ajax.get('/ms-terminal-order/orderData/getOrderNodes', {orderId: this.orderId}).then(response => {
        if (Array.isArray(response.data)) {
          this.orderNodes = response.data
        }
      })
    }
  }
}
</script>
